package ua.com.minus1.lookbattle;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Checkable;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;

/**
 * Created with IntelliJ IDEA.
 * User: Denis
 * Date: 09.10.12
 * Time: 23:11
 * To change this template use File | Settings | File Templates.
 */
public class LookListItem extends LinearLayout implements Checkable {

    private View mCheck;
    private boolean checked;

    public LookListItem(Context context, AttributeSet attrs) {
        super(context, attrs);
        checked = false;
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        mCheck = findViewById(R.id.list_item_look_check);
    }

    public void setChecked(boolean b) {
        checked = b;
        mCheck.setVisibility(b? VISIBLE: GONE);
    }

    public boolean isChecked() {
        return checked;
    }

    public void toggle() {
        setChecked(!checked);
    }

}
